package com.example.abstractFactory.test;

import com.example.abstractFactory.FruitsFactoryExtend;
import com.example.abstractFactory.PhoneFactoryExtend;
import com.example.abstractFactory.father.FruitsBehavior;
import com.example.abstractFactory.father.PhoneBehavior;

/**
 * 抽象工厂模式，多个产品属于一个产品蔟，一个产品蔟的工厂生产多种相关的产品
 */
public class User {
    public static void main(String[] args) {
        FruitsFactoryExtend fruitsFactoryExtend = new FruitsFactoryExtend();

        FruitsBehavior apple = fruitsFactoryExtend.getFruitsBehavior("apple");
        apple.eatFruit();

        PhoneFactoryExtend phoneFactoryExtend = new PhoneFactoryExtend();

        PhoneBehavior oppo = phoneFactoryExtend.getPhoneBehavior("oppo");
        oppo.usePhone();
    }
}
